package com.ikas.ai.server.kafka.strategy;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author hu.bowei@ikasinfo.com
 * @date 2023-11-06- 11:42
 */
@Service
public class Kafka104DataConvertMeteDataStrategyContext {

    @Resource
    private Map<String, Kafka104DataConvertMeteDataStrategy> strategyServiceMap;

    public Kafka104DataConvertMeteDataStrategy getResource(String type) {
        Kafka104DataConvertMeteDataStrategy strategy = strategyServiceMap.get(type);
        if (strategy == null) {
            throw new RuntimeException("no strategy defined");
        }
        return strategy;
    }
}
